// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 获取缺陷记录 GET /api/defectrecord */
export async function queryDefectRecord(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  },
  options?: { [key: string]: any },
) {
  return request<API.RequestData>('/api/defectrecord', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 更新缺陷记录 PUT /api/defectrecord */
export async function updateDefectRecord(
  body: API.DefectRecordItem,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/defectrecord', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}


/** 消缺 PUT /api/defectrecord */
export async function rectificationDefectRecord(
  body: API.DefectRecordItem,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/defectrecord/rectification', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}




/** 添加缺陷记录 POST /api/defectrecord */
export async function addDefectRecord(
  body: API.DefectRecordItem,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/defectrecord', {
    method: 'POST',
 
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}


/** 转缺陷记录 POST /api/defectrecord */
export async function convertDefectRecord(
  body: API.DefectRecordItem,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/defectrecord/convert', {
    method: 'POST',
    requestType: 'form',
    data: body,
    ...(options || {}),
  });
}



/** 删除缺陷记录 DELETE /api/defectrecord */
export async function removeDefectRecord(
  params: {
    // query
    /** 对象主键 */
    defectId?: number;
  },
  options?: { [key: string]: any }
) {
  return request<Record<string, any>>('/api/defectrecord', {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
